
#ifndef		CONNECTMENU_HH__
# define	CONNECTMENU_HH__

# include	<vector>
# include	<map>
# include	<iostream>
# include	<SFML/Graphics.hpp>
# include	"Icontext.hh"
# include	"GUI.hh"
# include	"Data.hh"
# include	"Tools.hpp"

class			ConnectMenu : public Icontext
{
public:
  ConnectMenu(sf::RenderWindow&, IGUI::e_context&, sf::Event&, Gomoku::Data&);
  ~ConnectMenu(void);
  virtual void		run(void);

private:
  virtual void		gere_key(void);
  virtual void		mouse(void);
  virtual void		resized(void);
  void			mouser(void);
  void			mouseHover(void);
  void			create(void);
  void			join(void);
  void			write(float, float, sf::Color, std::string);
  void			refreshInputText(void);
  bool			checkHover(int, std::vector<GObject*>&);

  Gomoku::Data		&info;
  IGUI::e_context	&focus;
  std::vector<void (ConnectMenu::*)(void)> status;
  std::map<sf::Event::EventType, void (ConnectMenu::*)(void)> action;
  sf::RenderWindow	&App;
  sf::Event		&Event;
  const sf::Input&	Input;
  std::vector<GObject*>	items;
  std::vector<GObject*>	inputs;
  sf::Image		bgm;
  sf::Image		cr;
  sf::Image		jo;
  sf::Image		jg;
  sf::Image		input;
  sf::String		str;
  int			st;
  int			wait;
  sf::IPAddress		IP;
  sf::SocketTCP		Listener;
  int			port;
  sf::SocketTCP		Client;
  sf::IPAddress		ClientAddress;
  int			focusText;
  int			w;
  int			goconnect;
  int			err;
};

#endif		/*!CONNECTMENU_HH__*/
